package com.boge.ai.utils;

import com.boge.ai.entity.ChatCompletionResponse;
import com.boge.ai.entity.embedd.EmbeddingResponse;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public class JsonToHashMapUtils {
    private static final ObjectMapper objectMapper = new ObjectMapper();

    public static ChatCompletionResponse parseJsonToResponse(String json) throws IOException {
        return objectMapper.readValue(json, ChatCompletionResponse.class);
    }

    public static EmbeddingResponse parseJsonToEmbeddingResponse(String json) throws IOException {
        return objectMapper.readValue(json, EmbeddingResponse.class);
    }
}

